package com.yeswater.multithread.chapter1.test1_11.test4;

import org.junit.Test;

import java.util.concurrent.TimeUnit;

/**
 * author : yeswater
 * date : 2023/10/18
 */

public class Run {
    @Test
    public void test1() throws InterruptedException {
        try {
            MyThread thread = new MyThread();
            thread.start();
            TimeUnit.SECONDS.sleep(1);
            thread.interrupt();
        } catch (InterruptedException e) {
            System.out.println("main catch");
            e.printStackTrace();
        }
        System.out.println("==== end ====");
    }

}
